package com.ryskoo.common.constant;

/**
 * 订单类型
 *
 * @author Monster
 */
public enum OrderTypeEnum {
    ORDINARY(1, "普通订单"),
    SECKILL(2, "秒杀订单"),
    GROUPBUY(3, "团购订单");

    private int value;
    private String name;

    OrderTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(int value) {
        for (OrderTypeEnum ote : OrderTypeEnum.values()) {
            if (ote.getValue() == value) {
                return ote.getName();
            }
        }
        return "";
    }
}
